package interator;

public class Test {
    public static void main(String[] args) {

        Student s1 = Student.build().name("dark").age(18).create();
        Student s2 = Student.build().name("crystal").age(16).create();
        Student s3 = Student.build().name("feifei").age(20).create();
        Student s4 = Student.build().name("mobai").age(17).create();

        Classroom classroom = new Classroom();
        classroom.addStudent(s1);
        classroom.addStudent(s2);
        classroom.addStudent(s3);
        classroom.addStudent(s4);

        Iterator iterator = classroom.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }


    }
}
